using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using Northwind.NET.Utilities;

using Northwind.NET.FE.zzzSamples;

namespace Northwind.NET.FE
{
    public partial class MainSwitchboardForm : Form
    {
        public MainSwitchboardForm()
        {
            InitializeComponent();
        }

        private void MainSwitchboardForm_Load(object sender, EventArgs e)
        {
            SimpleLogWriter.WriteLogLine(string.Format("{0} loaded.", this.Text));
            this.Text = this.Text +
                string.Format(" - v.{0}", Globals.APPLICATION_VERSION); 
        }

        private void cmdCategories_Click(object sender, EventArgs e)
        {
            Northwind.NET.FE.Globals.Navigator.OpenCategoriesForm();    
            this.Visible = false;
        }

        private void cmdSuppliers_Click(object sender, EventArgs e)
        {
            Northwind.NET.FE.Globals.Navigator.OpenSuppliersForm();
            this.Visible = false;
        }

        private void cmdProducts_Click(object sender, EventArgs e)
        {
            Northwind.NET.FE.Globals.Navigator.OpenProductsForm();
            this.Visible = false;
        }

        private void cmdOrders_Click(object sender, EventArgs e)
        {
            Northwind.NET.FE.Globals.Navigator.OpenOrdersForm();
            this.Visible = false;
        }

        private void cmdPrintSalesReports_Click(object sender, EventArgs e)
        {
            Northwind.NET.FE.Globals.Navigator.OpenPrintSalesReportsDialog();
            this.Visible = false;
        }

        private void cmdExit_Click(object sender, EventArgs e)
        {
            this.Close(); 
        }

        private void MainSwitchboardForm_FormClosed(object sender, FormClosedEventArgs e)
        {
            SimpleLogWriter.WriteLogLine(string.Format("{0} closed.", this.Text));
            GC.Collect();
            System.Environment.Exit(0);
        }

        private void cmdSamples_Click(object sender, EventArgs e)
        {
            SampleFormsAndReportsSwitchBoardForm form = new SampleFormsAndReportsSwitchBoardForm();
            form.Show(); 
        }

 
    }
}